<?php /* 我的房间 */
require_once('conn.inc.php');
@$logintime	=		time();										//登录时间
@$conn		=		mysql_connect($db_host,$db_user,$db_pwd);
mysql_query("set names 'utf8'");
mysql_select_db($db_name);

@$id 	=	 	$_POST["id"];
@$select	=	"select * from hometeam where fid='$id' && state='2' ";		
$result = mysql_query($select);
$num_rows = mysql_num_rows($result);
if ($num_rows >= 1) {
	$results = array('code'=>0);
	while ($row= mysql_fetch_array($result)) {
		$hid	=	$row['hid'];
		$sql	=	"select * from home where hid='$hid' ";
		$rsql	=	mysql_query($sql);
			while ($xx = mysql_fetch_assoc($rsql)) {
				$results[] = $xx;
			}
	}
	// 将数组转成json格式
	echo json_encode($results);
}else {
	$rc = array('code'=>-1);
	echo json_encode($rc);										//没有历史组局
}
mysql_close();